package main

import (
	"fmt"
	"math/rand"
)

func main() {

	set := make(map[int]struct{}, 10)
	fmt.Println(set)

	for i := 0; i < 10; i++ {
		set[rand.Intn(10)] = struct{}{}
	}
	fmt.Println(set)

	var s []int = KeySet(set)
	fmt.Println(s)
}

func KeySet(set map[int]struct{}) []int {
	sliceResult := make([]int, 0, len(set))
	for k, _ := range set {
		fmt.Println(k)
		//sliceResult[0] = k
		sliceResult = append(sliceResult, k)
	}
	return sliceResult
}
